package com.sweet.lambda;

public class Main2 {

    public static void main(String[] args) {
        ILove lv;
        // 多参数 参数类型可以省略
        lv = (int a, int b) -> {
            System.out.println("love " + a);
            System.out.println("love " + b);
        };
        lv.say(1,2);

        lv = (a, b) -> {
            System.out.println("love " + a);
            System.out.println("love " + b);
        };
        lv.say(3,4);

        // 单参数 单方法语句省略过程
        ILove2 lv2;
        lv2 = (int a) -> {
            System.out.println("love lv " + a);
        };
        lv2.say(5);

        lv2 = (a) -> {
            System.out.println("love lv " + a);
        };
        lv2.say(6);

        lv2 = a -> {
            System.out.println("love lv " + a);
        };
        lv2.say(7);

        lv2 = a -> System.out.println("love lv " + a);
        lv2.say(8);


    }
}

interface ILove {
    void say(int a, int b);
}

interface ILove2 {
    void say(int a);
}